/**
 * @author Justin Akin
 * @version Action Pals Core Library 0.1.0
 */
package com.actionpals.graphics
{
	import flash.geom.Rectangle;
	
	public class AbstractRoundedShape extends AbstractShape
	{
		
		/**
		 * @private
		 */		
		protected var _cornerRadius:uint;
		
		
		/**
		 * Constructs a new AbstractRoundedShape.  This class is meant to be subclassed by other shapes
		 * which need to make use of rounded corners.
		 *  
		 * @param width
		 * @param height
		 * @param cornerRadius
		 * @param color
		 * @param strokeThickness
		 * @param strokeColor
		 */		
		public function AbstractRoundedShape( width:Number, height:Number, cornerRadius:uint = 0, fillColor:uint = 0, strokeThickness:uint = 0, strokeColor:uint = 0 )
		{
			_cornerRadius = cornerRadius;
			super( width, height, fillColor, strokeThickness, strokeColor );
		}
		
		/**
		 * The radius of each rounded corner.
		 * 
		 * @return 
		 */		
		public function get cornerRadius():uint
		{
			return _cornerRadius;
		}
		
		/**
		 * @private
		 */		
		public function set cornerRadius( value:uint ):void
		{
			_cornerRadius = value;
			invalidate();
		}
		
		/**
		 * @private
		 */	
		protected function get innerRadius():uint
		{
			var r:uint = ( _cornerRadius > _strokeThickness ) ? _cornerRadius - _strokeThickness : 0;
			return r;
		}
	}
}